<?php
/**
 * @descrption : This page is hidden to end user, and is used for detect 3G connect and redirection to specific page.
 * @             URL: http://mobile.three.com.hk/checker/mytvbtvpre/h3g/redirect.php
 * @date       : Mar 1,2011
 * @
 */
$var      = getallheaders();
$msisdn   = (isset($var['X-H3G-MSISDN'])) ? $var['X-H3G-MSISDN'] : 'WiFi';
$callback = (isset($_REQUEST['call_back'])) ? $_REQUEST['call_back'] : NULL;
if ($msisdn != 'WiFi') {
    $msisdn = base64_encode($msisdn.'|'.time());
    if (empty($callback)) {
        echo $msisdn;
        exit;
    }
    $callback_url = $callback.'&msisdn='.$msisdn;
    Header("Location:$callback_url");
    exit;
}
else {
    echo "can't get the msisdn string!<br/>Maybe have some wrong with this process!<br/>";
    exit;
}

?>
